RebaseThere are two main ways to use the git rebase command:
- Alternative to merging
- Clean up tool
Rebase ProblemsLots of changes of main create the need to git merge which creates new commits.
💡 Fast Forward commits can only happen when you have new commits on your branch and main has not had any at the point of your merge. Rebase Workflowgit checkout your branchgit rebase main
Golden Rule of Rebase💡 NEVER REBASE COMMITS THAT HAVE BEEN SHARED WITH OTHERS.
So we rebase onto the branch that we currently are on.